package com.netas.kekmanager.dao;
import com.netas.kekmanager.dao.model.WebResource;
import com.netas.kekmanager.dao.model.WebResourcePk;
import com.netas.kekmanager.dao.exceptions.WebResourceDaoException;
import java.util.List;

public interface WebResourceDao
{
	/**
	 * Method 'insert'
	 * 
	 * @param dto
	 * @return WebResourcePk
	 */
	public WebResourcePk insert(WebResource dto);

	/** 
	 * Updates a single row in the web_resource table.
	 */
	public void update(WebResourcePk pk, WebResource dto) throws WebResourceDaoException;

	/** 
	 * Deletes a single row in the web_resource table.
	 */
	public void delete(WebResourcePk pk) throws WebResourceDaoException;

	/** 
	 * Returns all rows from the web_resource table that match the criteria 'id = :id'.
	 */
	public WebResource findByPrimaryKey(int id) throws WebResourceDaoException;

	/** 
	 * Returns all rows from the web_resource table that match the criteria ''.
	 */
	public List<WebResource> findAll() throws WebResourceDaoException;

	/** 
	 * Returns all rows from the web_resource table that match the criteria 'web_resource_type_id = :webResourceTypeId'.
	 */
	public List<WebResource> findByWebResourceType(int webResourceTypeId) throws WebResourceDaoException;

	/** 
	 * Returns all rows from the web_resource table that match the criteria 'id = :id'.
	 */
	public List<WebResource> findWhereIdEquals(int id) throws WebResourceDaoException;

	/** 
	 * Returns all rows from the web_resource table that match the criteria 'web_resource_type_id = :webResourceTypeId'.
	 */
	public List<WebResource> findWhereWebResourceTypeIdEquals(int webResourceTypeId) throws WebResourceDaoException;

	/** 
	 * Returns all rows from the web_resource table that match the criteria 'url_hash_id = :urlHashId'.
	 */
	public List<WebResource> findWhereUrlHashIdEquals(int urlHashId) throws WebResourceDaoException;

	/** 
	 * Returns all rows from the web_resource table that match the criteria 'url = :url'.
	 */
	public List<WebResource> findWhereUrlEquals(String url) throws WebResourceDaoException;

	/** 
	 * Returns all rows from the web_resource table that match the criteria 'title = :title'.
	 */
	public List<WebResource> findWhereTitleEquals(String title) throws WebResourceDaoException;

	/** 
	 * Returns all rows from the web_resource table that match the criteria 'description = :description'.
	 */
	public List<WebResource> findWhereDescriptionEquals(String description) throws WebResourceDaoException;

	/** 
	 * Returns all rows from the web_resource table that match the criteria 'thumbnail_file_name = :thumbnailFileName'.
	 */
	public List<WebResource> findWhereThumbnailFileNameEquals(String thumbnailFileName) throws WebResourceDaoException;

	/** 
	 * Returns all rows from the web_resource table that match the criteria 'average_rating = :averageRating'.
	 */
	public List<WebResource> findWhereAverageRatingEquals(String averageRating) throws WebResourceDaoException;

	/** 
	 * Returns the rows from the web_resource table that matches the specified primary-key value.
	 */
	public WebResource findByPrimaryKey(WebResourcePk pk) throws WebResourceDaoException;
        
        public List<WebResource> findLatest(int limit, int webResourceType) throws WebResourceDaoException;
        
        public List<WebResource> findTop(int limit, int webResourceType) throws WebResourceDaoException;

}
